﻿using System.Data;
using System.Data.SqlClient;
namespace MyWeb.Data
{
	public class tblSTAFF_TYPEDAL : SqlDataProvider
	{

		#region[tblSTAFF_TYPE_GetbyAll]
		public DataTable tblSTAFF_TYPE_GetByAll()
		{
			using (var cmd = new SqlCommand("sp_tblSTAFF_TYPE_GetByAll", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				return GetTable(cmd);
			}
		}
		#endregion
		#region[tblSTAFF_TYPE_GetbyId]
		public DataTable tblSTAFF_TYPE_GetById(string STAFF_TYPE_CODE)
		{
			using (var cmd = new SqlCommand("sp_tblSTAFF_TYPE_GetById", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				cmd.Parameters.Add(new SqlParameter("@STAFF_TYPE_CODE", STAFF_TYPE_CODE));return GetTable(cmd);
			}
		}
		#endregion
		#region[tblSTAFF_TYPE_GetbyTop]
		public DataTable tblSTAFF_TYPE_GetByTop(string Top, string Where, string Order)
		{
			using (var cmd = new SqlCommand("sp_tblSTAFF_TYPE_GetByTop", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				var da = new SqlDataAdapter(cmd);
				cmd.Parameters.Add(new SqlParameter("@Top",Top));
				cmd.Parameters.Add(new SqlParameter("@Where",Where));
				cmd.Parameters.Add(new SqlParameter("@Order",Order));
				return GetTable(cmd);
			}
		}
		#endregion
		#region[tblSTAFF_TYPE_Insert]
		public void tblSTAFF_TYPE_Insert(tblSTAFF_TYPEInfo Data)
		{
			using (var cmd = new SqlCommand("sp_tblSTAFF_TYPE_Insert", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				cmd.Parameters.Add(new SqlParameter("@STAFF_TYPE_CODE", Data.STAFF_TYPE_CODE));
				cmd.Parameters.Add(new SqlParameter("@STAFF_TYPE_DESCRIPTION", Data.STAFF_TYPE_DESCRIPTION));
				ExeCuteNonquery(cmd);
			}
		}
		#endregion
		#region[tblSTAFF_TYPE_Update]
		public void tblSTAFF_TYPE_Update(tblSTAFF_TYPEInfo Data)
		{
			using (var cmd = new SqlCommand("sp_tblSTAFF_TYPE_Update", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				cmd.Parameters.Add(new SqlParameter("@STAFF_TYPE_CODE", Data.STAFF_TYPE_CODE));
				cmd.Parameters.Add(new SqlParameter("@STAFF_TYPE_DESCRIPTION", Data.STAFF_TYPE_DESCRIPTION));
				ExeCuteNonquery(cmd);
			}
		}
		#endregion
		#region[tblSTAFF_TYPE_Delete]
		public void tblSTAFF_TYPE_Delete(string STAFF_TYPE_CODE)
		{
			using (var cmd = new SqlCommand("sp_tblSTAFF_TYPE_Delete", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				cmd.Parameters.Add(new SqlParameter("@STAFF_TYPE_CODE",STAFF_TYPE_CODE));
				ExeCuteNonquery(cmd);
			}
		}
		#endregion
	}
}